home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 October: Mac OS SDK / Dev.CD Oct 96 SDK / Dev.CD Oct 96 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / ODF / Found / FWStream / Include / SLBufSin.idl < prev    next >
Encoding:
Text File  |  1996-08-16  |  2.2 KB  |  98 lines  |  [TEXT/MPS ]

  1. //
  2. //    File:        SLBufSin.idl
  3. //
  4. //    Contains:    Interface for abstract random access sink class
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8.  
  9. #ifndef SLBUFSIN_IDL
  10. #define SLBUFSIN_IDL
  11.  
  12. #ifndef SLRANSIN_IDL
  13. #include "SLRanSin.idl"
  14. #endif
  15.  
  16. //==============================================================================
  17. // Classes defined in this interface
  18. //==============================================================================
  19.  
  20. interface   FW_OBufferedSink;
  21.  
  22.  
  23. //==============================================================================
  24. // Classes used by this interface
  25. //==============================================================================
  26.  
  27. interface FW_ORandomAccessSink;
  28.  
  29.  
  30. //==============================================================================
  31. // Types used by this interface
  32. //==============================================================================
  33.  
  34.  
  35. //========================================================================================
  36. // FW_ORandomAccessSink
  37. //    This class wraps the random access sink passed to it with a buffer.  The xxxPeakxxx
  38. //    methods are turned on, using the buffer for peeking and the wrapped sink (shades of
  39. //    Cristo!) for accessing the data.
  40. //========================================================================================
  41.  
  42. interface FW_OBufferedSink : FW_ORandomAccessSink
  43. {
  44.     void InitFromSink(in FW_ORandomAccessSink aSink, in long bufferCapacity);
  45.     FW_ORandomAccessSink GetORandomAccessSink();
  46.  
  47.     void Flush();
  48.         // Assure that all data has been written from the buffer and force the next
  49.         // reads to fill the buffer.
  50.  
  51. #ifdef __SOMIDL__
  52.     implementation
  53.     {
  54.         functionprefix = "FW_OBufferedSink__";
  55.  
  56.         override:
  57.             somInit,
  58.             somUninit,
  59.  
  60.             GetReadableBytes,
  61.             Read,
  62.             GetWritableBytes,
  63.             Write,
  64.             GetLength,
  65.             SetLength,
  66.             GetPosition,
  67.             SetPosition;
  68.  
  69.         releaseorder:
  70.             InitFromSink,
  71.             GetORandomAccessSink,
  72.             Flush;
  73.  
  74.         majorversion = 1;
  75.         minorversion = 0;
  76.  
  77.         passthru C_xh =
  78.             "";
  79.  
  80.         passthru C_xih =
  81.             "";
  82.  
  83. #ifdef __PRIVATE__    
  84.     FW_ORandomAccessSink    fWrappedSink;
  85.     char*                    fBuffer;
  86.     long                    fCapacity;
  87.     long                    fInitialPosition;
  88.     long                    fValidBytes;
  89.     long                    fBytesWritten;
  90.     long                    fType;
  91. #endif
  92.     };
  93. #endif
  94. };
  95.  
  96.  
  97. #endif
  98.